{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "3982f535092a45729476b578a6b2bd77",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Plot(antialias=3, axes=['x', 'y', 'z'], axes_helper=1.0, background_color=16777215, camera=[-0.014307049787521…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from vedo import *\n",
    "\n",
    "bu = load(datadir+'bunny.obj')\n",
    "\n",
    "bu.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Manually set the k3d camera. Syntax is:\n",
    "# [posx,posy,posz, targetx,targety,targetz, upx,upy,upz]\n",
    "settings.notebook_plotter.camera = [0., 0. ,1.,\n",
    "                                    0., 0., 0.,\n",
    "                                    0., 1., 0.]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[1mk3dcam is [-0.0068  0.044   0.192  -0.017   0.11    0.08    0.      1.      0.    ]\u001b[0m\n"
     ]
    }
   ],
   "source": [
    "# Convert a vtkCamera object into the appropiate K3D list\n",
    "import vtk\n",
    "vcam = vtk.vtkCamera()\n",
    "vcam.SetPosition( [-0.017, 0.11, 0.48] )\n",
    "vcam.SetFocalPoint( [-0.017, 0.11, -0.001] )\n",
    "vcam.SetViewUp( [0.0, 1.0, 0.0] )\n",
    "vcam.SetDistance( 0.4 )\n",
    "k3dcam = vtkCameraToK3D(vcam)\n",
    "printc('k3dcam is', k3dcam)\n",
    "\n",
    "settings.notebook_plotter.camera = k3dcam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
